﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SwParaPlatform2.dlgRuleConfig
{
    public delegate void EventHandler();

    public interface IDelegate
    {

    }

    public interface IModel
    {
        List<string> GetSelectDrwList();
        List<string> GetDriveTypeList();
        List<Dictionary<string, object>> GetFormulaList();
        Dictionary<string, object> GetNestDict();
        Dictionary<string, Dictionary<string, object>> GetRuleData();
        Dictionary<string, Dictionary<string, object>> GetAllRuleConfigData();
        string GetSelectCompName();
        string GetSelectDriveType();
        string GetSelectElementFullPath();
        void OnSelectCompName(string sName);
        void OnSelectDriveType(string sName);
        void OnSelectElement(string sElement);
        void OnAddRuleConfigData();
        void SetRuleData(Dictionary<string, Dictionary<string, object>> dRuleData);
        void ClearData(bool bClearAllData);
        string SaveData();
        void LoadData();
        void LoadAllData();
        void OnSelectRow(string sSelectPara);
        void OnDelSelectPara();
        void OnChangeData();
        void SetSelectDrwList(List<string> SelectDrwList);
        string GetSelectElement();

        List<string> GetKeysWithMatchingTypeNames(
        Dictionary<string, Dictionary<string, object>> nestedDictionary, List<string> typeNames);

        event EventHandler SelectCompChanged;
        event EventHandler SelectDriveTypeChanged;
        event EventHandler RefreshAllRuleConfigData;
        event EventHandler OnSetRuleData;
        event EventHandler SelectRowChanged;
        event EventHandler OnSelectElementSignal;
        
    }

    public interface IView
    {
        event System.EventHandler OpenNodeSelected;
        event System.EventHandler OpenRuleSetter;
        event System.EventHandler OnClearRule;
        event System.EventHandler OnClearComp;
        event System.EventHandler AddRuleConfig;
        event System.EventHandler NextClicked;
        event System.EventHandler LoadDataBtnClicked;
        event System.EventHandler CheckDefaultSelect;
        event System.EventHandler SaveBtnClicked;
        event System.EventHandler DelBtnClicked;
        event System.EventHandler ChangeBtnClicked;
        event System.EventHandler OpenEditEquation;

        event EventHandler<string> SelectRow;

        event Action<string> DriveTypeChanged;
        event Action<string> SelectElementChanged;

        void LoadSelectElement(string sRuleText);
        void LoadSelectDriveType(string sRuleText);
        void OnSetRuleData(string sRuleText);
        void SetSelectCompName(string sSelectCompName);
        void SetDriveTypeList(List<string> inputTypeList);
        void SetElementList(List<string> lElementList);
        void RefreshAllRuleGridData(Dictionary<string, Dictionary<string, object>> dAllRuleConfigData);
        void ClearDriveType();
        void ClearElement();
        void ClearRule();
        void ClearComp();
        void BanSelectNodeBtn();
        void RefreshRuleBtnState(bool bEnable);
        void RefreshTipsShow(bool bShow);
        void RefreshEquationBtnState(bool bEnable);
        Form DoFindForm();
    }
}
